{% extends 'myadmin/base.html' %}

{% block title %}
<title>员工编辑</title>
{% endblock %}

{% block con %}

<div class="widget am-cf">
    <div class="widget-head am-cf">
        <div class="widget-title am-fl"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">员工编辑表单</font></font></div>
        <div class="widget-function am-fr">
            <a href="javascript:;" class="am-icon-cog"></a>
        </div>
    </div>
    <div class="widget-body am-fr">

        <form class="am-form tpl-form-line-form" action="{% url 'myadmin_staff_update' %}" method="post" enctype="multipart/form-data">
        	{% csrf_token %}
            
            <input type="hidden" name="id" value="{{ staff.id }}">
            <div class="am-form-group">
                <label for="user-phone" class="am-u-sm-3 am-form-label">
                	*员工所属部门
                </label>
                <div class="am-u-sm-9">
                    <select name="branchtypeid" data-am-selected="{searchBox: 0}">
						{% for i in types %}
						<option value="{{ i.id }}" {% if i.pid == 0 %} disabled {% endif %} {% if i.id in ts %} selected {% endif %}>{{ i.sb }}{{ i.name }}</option>
						{% endfor %}
					</select>
                </div>
            </div>
            <div class="am-form-group">
                <label for="user-phone" class="am-u-sm-3 am-form-label">
                	*姓名
                </label>
                <div class="am-u-sm-9">
                    <input type="text" name="name" value="{{ staff.name }}" required class="tpl-form-input" placeholder="请输入员工姓名">
                </div>
            </div>  
            <div class="am-form-group">
                <label for="user-phone" class="am-u-sm-3 am-form-label">
                    *手机号
                </label>
                <div class="am-u-sm-9">
                    <input type="text" name="phone" value="{{ staff.phone }}" required minlength="11" maxlength="11" class="tpl-form-input" placeholder="请输入员工手机号">
                </div>
            </div>
            <div class="am-form-group">
                <label for="user-phone" class="am-u-sm-3 am-form-label">
                    *密码
                </label>
                <div class="am-u-sm-9">
                    <input type="hidden" name="old_password" value="{{ staff.password }}" required minlength="6" maxlength="12" class="tpl-form-input" placeholder="请输入员工密码">
                    <input type="text" name="password" value="{{ staff.password }}" required minlength="6" maxlength="12" class="tpl-form-input" placeholder="请输入员工密码">
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-3 am-form-label">
                    *头像
                </label>
                <div class="am-u-sm-9">
                    <div class="am-form-group am-form-file">
                        <div class="tpl-form-file-img">
                            <img class="topimg" src="" alt=""style="width: 100px;">
                        </div>
                        <button type="button" class="am-btn am-btn-danger am-btn-sm">
                            <i class="am-icon-cloud-upload"></i>
                             编辑头像
                        </button>
                        <input id="doc-form-file" name="face" type="file" multiple="">
                        <input id="doc-form-file" name="old_face" value="{{ staff.face }}" type="hidden" multiple="">
                    </div>

                </div>
            </div>
            <div class="am-form-group">
                <label for="user-phone" class="am-u-sm-3 am-form-label">
                    *居住地址
                </label>
                <div class="am-u-sm-9">
                    <input type="text" name="homeaddress" value="{{ staff.homeaddress }}" class="tpl-form-input" placeholder="请输入员工地址">
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-u-sm-3 am-form-label">
                    性别
                </label>
                <div class="am-u-sm-9">
                    <label class="am-radio-inline"><input type="radio" {% if obj.sex != '0' %} checked {% endif %} value="1" name="sex"> 男</label>
                    <label class="am-radio-inline"><input type="radio" {% if obj.sex == '0' %} checked {% endif %} value="0" name="sex"> 女</label>
                </div>
            </div>
            <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3">
                    <button class="am-btn am-btn-primary tpl-btn-bg-color-success "><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">提交</font></font></button>
                </div>
            </div>
        </form>
    </div>
</div>

</div>



{% endblock %}